package com.laijiale.dto;

import com.laijiale.constant.RE;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * @author laijiale
 * @date 2025年01月09日 11:30
 */


 @Schema(name="类别添加DTO")
 @Data
 public class CategoryInsertDTO implements Serializable, RE {
    @NotEmpty(message = "标题不能为空")
    @Pattern(regexp = TITLE_RE, message = TITLE_RE_MSG)
    @Schema(description = "标题")
    private String title;
    @Pattern(regexp = INFO_RE, message = INFO_RE_MSG)
    @Schema(description = "描述")
    private String info;
    @Range(min = 0, message = "序号最小为0")
    @Schema(description = "序号")
    private Long idx;
}
